/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.losalpes.catalogo.servicios;

import com.losalpes.catalogo.bos.CarItem;
import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author da.joya49
 */
public class StoreServiceMock implements IStoreServiceMock {

    private List<CarItem> carItems = null;

    /**
     *
     */
    public StoreServiceMock(){
        carItems = new ArrayList<CarItem>();
    }

    /**
     * 
     * @param mueble
     */
    @Override
    public void addToCar(CarItem carItem) {

        if( carItems != null) {

            carItems.add(carItem);
            CarItem.total += carItem.getMueble().getPrecio() * carItem.getCantidad();
        }
    }

    /**
     * 
     * @return
     */
    @Override
    public List<CarItem> getCarItems() {

        return carItems;
    }
}
